import { request } from '@/utils';
import { createPublicCourseParams, searchParams, alterPublicCourseParams } from './types';

/** 创建公开课 */
export const createPublicCourse = (createPublicCourseParams: createPublicCourseParams) => {
  return request.post('/api/course/PublicClassInfo', createPublicCourseParams);
};

/** 查询公开课 */
export const searchPublicCourse = (searchParams: searchParams) => {
  return request.post('/api/course/searchPB', searchParams);
};

/** 修改公开课 */
export const updatePublicCourse = (alterPublicCourseParams: alterPublicCourseParams) => {
  return request.post('/api/course/AlterPB', alterPublicCourseParams);
};

/** 删除公开课 */
export const deletePublicCourse = (ids: number[]) => {
  return request.delete('/api/course/PublicClassInfo', { data: { ids } });
};